<template>
	<view>
		<uni-nav-bar left-icon="left" backgroundColor="#1172F6" :border="false" color="#fff"
			@clickLeft="onClickNavBack">
			<view class="nav-title">推广大使</view>
		</uni-nav-bar>
		<view class="content" :style="{height:clientHeight + 'px'}">
			<image src="@/static/images/ambassador.jpg" mode=""></image>
		</view>
	</view>
</template>

<script setup>
	import {
		ref,

	} from 'vue'
	import {
		onLoad
	} from '@dcloudio/uni-app'
	const onClickNavBack = () => {

		uni.navigateBack()
	}
	const getBarHeight = () => {
		const res = uni.getSystemInfoSync()
		if (res.platform === 'ios') {
			return 44 + res.statusBarHeight
		} else if (res.platform === 'android') {
			return 48 + res.statusBarHeight
		} else {
			return 0;
		}
	}
	const clientHeight = ref('')
	//获取可视区域高度
	const getClineHeight = () => {

		uni.getSystemInfo({
			success: (res => {
				clientHeight.value = res.windowHeight - uni.upx2px(80) - getBarHeight();
			})
		});
		// console.log('clientHeight', clientHeight)
	}
	//获取我的身份
	const getIdentity = (userIdentity) => {

		switch (userIdentity) {
			case 0:
				return '普通会员'
				break;
			case 1:
				return '零售商'
				break;
			case 2:
				return '代理商'
				break;
			case 3:
				return '批发商'
				break;
			case 4:
				return '推广大使'
				break;
			default:
				break;
		}

	}
	const userIdentity = ref('')
	onLoad((ops) => {
		console.log('ops', ops.userIdentity)
		userIdentity.value = getIdentity(Number(ops.userIdentity))
		// console.log('userIdentity.value', getIdentity(ops.userIdentity))
		getClineHeight()
	})
</script>

<style lang="scss" scoped>
	page {
		overflow: hidden;
	}

	.nav-title {
		font-size: 32rpx;
		display: flex;
		align-items: center;
		justify-items: center;
		justify-content: center;
		flex: 1;
	}

	.content {
		// height: 90vh;
		/* width: 100%; */
		padding: 10px;
		box-sizing: border-box;
		overflow: hidden;

		image {
			width: 100%;
			height: 100%;
		}
	}
</style>